package a.f;

import a.c.j;
import a.c.k;
import a.c.m;
import a.d.s;
import a.d.u;
import a.i.db;
import a.i.p;

import java.awt.*;

public class cb
  extends r
  implements uc
{
  k g;
  k h;
  k i;
  k j;
  private j k = null;
  private j l = null;
  private byte m;
  private int n = 4;
  private boolean o = true;
  public static final int p = 0;
  public static final int q = 1;
  public static final int r = 2;
  public static final int s = 4;
  public static final int t = 8;
  private static final String u = "PARTITION_ORIENTATION_DPKEY";
  public static int v;
  
  public cb(rc paramrc)
  {
    this();
    a(paramrc);
    a((byte)0);
  }
  
  public cb() {}
  
  public cb(byte paramByte)
  {
    a(paramByte);
  }
  
  public void a(byte paramByte)
  {
    this.m = paramByte;
  }
  
  public byte b()
  {
    return this.m;
  }
  
  public int c()
  {
    return this.n;
  }
  
  public void a(int paramInt)
  {
    this.n = paramInt;
  }
  
  public boolean d()
  {
    boolean bool = o.eg;
    if (!bool) {
      if (this.m != 1) {
        if (bool) {
          break label29;
        }
      }
    }
    label29:
    return this.m == 3;
  }
  
  public boolean e()
  {
    return this.o;
  }
  
  public void a(boolean paramBoolean)
  {
    this.o = paramBoolean;
  }
  
  public boolean canLayout(o paramo)
  {
    return b(paramo);
  }
  
  public void doLayout(o paramo)
  {
    boolean bool = o.eg;
    paramo.a("PARTITION_ORIENTATION_DPKEY", q.a(this));
    a_ locala_ = new a_();
    a.f.d.a.kc localkc = a.f.d.a.kc.d(paramo);
    if (!bool)
    {
      if (localkc != null) {
        localkc.b(this, locala_);
      }
      this.k = db.c();
      this.l = db.c();
      c(paramo);
    }
    if (!bool)
    {
      if (a() != null) {
        a(paramo);
      }
      i(paramo);
      this.k = null;
    }
    this.l = null;
    if (!bool)
    {
      if (localkc != null) {
        localkc.a(this, locala_);
      }
      paramo.j("PARTITION_ORIENTATION_DPKEY");
    }
  }
  
  public boolean b(byte paramByte)
  {
    boolean bool2 = o.eg;
    int i1 = o.dg;
    boolean bool1 = false;
    if (!bool2) {
      switch (paramByte)
      {
      case 0: 
        if (!bool2) {}
        bool1 = (0x1 & this.n) != 0;
        if (bool2) {
          break label168;
        }
        if (i1 == 0) {
          break;
        }
      case 3: 
        if (!bool2) {}
        bool1 = (0x2 & this.n) != 0;
        if (bool2) {
          break label168;
        }
        if (i1 == 0) {
          break;
        }
      case 2: 
        if (!bool2) {}
        bool1 = (0x4 & this.n) != 0;
        if (bool2) {
          break label168;
        }
        if (i1 == 0) {
          break;
        }
      case 1: 
        if (!bool2) {}
        bool1 = (0x8 & this.n) != 0;
        if (bool2) {
          break label168;
        }
        if (i1 == 0) {
          break;
        }
      }
    } else {
      bool1 = false;
    }
    label168:
    return bool1;
  }
  
  protected void c(o paramo)
  {
    h(paramo);
    l(paramo);
    o(paramo);
    p(paramo);
    f(paramo);
    d(paramo);
  }
  
  private void d(o paramo)
  {
    Object localObject = paramo.c(i.e);
    if (localObject != null)
    {
      localObject = new d_((k)localObject);
      paramo.a(i.e, (k)localObject);
    }
  }
  
  private void e(o paramo)
  {
    k localk = paramo.c(i.e);
    if ((o.eg) || (localk != null))
    {
      localk = ((d_)localk).c;
      paramo.j(i.e);
      paramo.a(i.e, localk);
    }
  }
  
  private void f(o paramo)
  {
    Object localObject = paramo.c(i.d);
    if ((h.b(paramo)) && (localObject != null))
    {
      localObject = new b_((k)localObject);
      paramo.a(i.d, (k)localObject);
    }
  }
  
  private void g(o paramo)
  {
    boolean bool = o.eg;
    k localk = paramo.c(i.d);
    if ((bool) || ((h.b(paramo)) && ((bool) || ((localk instanceof b_)))))
    {
      localk = ((b_)localk).c;
      paramo.j(i.d);
      paramo.a(i.d, localk);
    }
  }
  
  private void h(o paramo)
  {
    boolean bool = o.eg;
    int i1 = o.dg;
    a.c.w localw = paramo.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      a.d.w localw1 = paramo.o(localw.d());
      if (!bool)
      {
        if (d())
        {
          zc localzc = paramo.k(localw.d());
          localzc.b(localzc.d(), localzc.c());
        }
        paramo.a(localw.d(), a(localw1));
        localw.f();
      }
    } while (i1 == 0);
  }
  
  protected void i(o paramo)
  {
    j(paramo);
    k(paramo);
    m(paramo);
    n(paramo);
    g(paramo);
    e(paramo);
  }
  
  private void j(o paramo)
  {
    boolean bool = o.eg;
    int i1 = o.dg;
    a.c.w localw = paramo.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      a.d.w localw1 = paramo.o(localw.d());
      if (!bool)
      {
        if (d())
        {
          zc localzc = paramo.k(localw.d());
          localzc.b(localzc.d(), localzc.c());
        }
        paramo.a(localw.d(), b(localw1));
        localw.f();
      }
    } while (i1 == 0);
  }
  
  private void k(o paramo)
  {
    boolean bool = o.eg;
    int i2 = o.dg;
    m localm = paramo.w();
    label150:
    label152:
    do
    {
      do
      {
        if (!localm.e()) {
          return;
        }
        zb localzb = paramo.e(localm.a());
        a.d.w localw = localzb.c();
        localzb.a(b(localw));
        localw = localzb.d();
        localzb.b(b(localw));
        int i1 = 0;
        do
        {
          if (i1 >= localzb.a()) {
            break;
          }
          localw = b(localzb.a(i1));
          localzb.a(i1, localw.a(), localw.b());
          i1++;
          if (bool) {
            break label152;
          }
          if (i2 != 0) {
            break label150;
          }
        } while (i2 == 0);
      } while (bool);
      localm.f();
    } while (i2 == 0);
  }
  
  private void l(o paramo)
  {
    boolean bool = o.eg;
    int i2 = o.dg;
    m localm = paramo.w();
    label150:
    label152:
    do
    {
      do
      {
        if (!localm.e()) {
          return;
        }
        zb localzb = paramo.e(localm.a());
        a.d.w localw = localzb.c();
        localzb.a(a(localw));
        localw = localzb.d();
        localzb.b(a(localw));
        int i1 = 0;
        do
        {
          if (i1 >= localzb.a()) {
            break;
          }
          localw = a(localzb.a(i1));
          localzb.a(i1, localw.a(), localw.b());
          i1++;
          if (bool) {
            break label152;
          }
          if (i2 != 0) {
            break label150;
          }
        } while (i2 == 0);
      } while (bool);
      localm.f();
    } while (i2 == 0);
  }
  
  protected a.d.w a(a.d.w paramw, boolean paramBoolean)
  {
    return paramBoolean ? a(paramw) : b(paramw);
  }
  
  protected a.d.w a(a.d.w paramw)
  {
    boolean bool = o.eg;
    if (!bool) {
      if (b(this.m))
      {
        if (!bool) {
          switch (this.m)
          {
          case 0: 
            return new a.d.w(-paramw.a, paramw.b);
          case 1: 
            return new a.d.w(paramw.b(), paramw.a());
          case 3: 
            return new a.d.w(-paramw.b(), -paramw.a());
          case 2: 
            return new a.d.w(paramw.a(), -paramw.b());
          }
        }
        if ((!bool) && (o.dg == 0)) {
          return paramw;
        }
      }
    }
    switch (this.m)
    {
    case 0: 
      return paramw;
    case 1: 
      return new a.d.w(-paramw.b(), paramw.a());
    case 3: 
      return new a.d.w(paramw.b(), -paramw.a());
    case 2: 
      return new a.d.w(-paramw.a(), -paramw.b());
    }
    return paramw;
  }
  
  protected a.d.w b(a.d.w paramw)
  {
    boolean bool = o.eg;
    if (!bool) {
      if (b(this.m))
      {
        if (!bool) {
          switch (this.m)
          {
          case 0: 
            return new a.d.w(-paramw.a, paramw.b);
          case 1: 
            return new a.d.w(paramw.b(), paramw.a());
          case 3: 
            return new a.d.w(-paramw.b(), -paramw.a());
          case 2: 
            return new a.d.w(paramw.a(), -paramw.b());
          }
        }
        if ((!bool) && (o.dg == 0)) {
          return paramw;
        }
      }
    }
    switch (this.m)
    {
    case 0: 
      return paramw;
    case 1: 
      return new a.d.w(paramw.b(), -paramw.a());
    case 3: 
      return new a.d.w(-paramw.b(), paramw.a());
    case 2: 
      return new a.d.w(-paramw.a(), -paramw.b());
    }
    return paramw;
  }
  
  private void m(o paramo)
  {
    boolean bool = o.eg;
    if (!bool)
    {
      if (this.g != null)
      {
        paramo.a(ed.a, this.g);
        this.g = null;
        this.i = null;
      }
      if (bool) {}
    }
    else
    {
      if (this.h == null) {
        return;
      }
      paramo.a(ed.b, this.h);
      this.h = null;
    }
    this.j = null;
  }
  
  private void n(o paramo)
  {
    a(paramo, false);
  }
  
  private void o(o paramo)
  {
    boolean bool = o.eg;
    this.g = paramo.c(ed.a);
    if (!bool)
    {
      if (this.g != null)
      {
        this.i = new c_(this.g);
        paramo.a(ed.a, this.i);
      }
      this.h = paramo.c(ed.b);
    }
    if ((bool) || (this.h != null))
    {
      this.j = new c_(this.h);
      paramo.a(ed.b, this.j);
    }
  }
  
  private void p(o paramo)
  {
    a(paramo, true);
  }
  
  private void a(o paramo, boolean paramBoolean)
  {
    d(paramo, paramBoolean);
    if ((o.eg) || (e())) {
      b(paramo, paramBoolean);
    }
  }
  
  private void b(o paramo, boolean paramBoolean)
  {
    boolean bool = o.eg;
    int i2 = o.dg;
    k localk = paramo.c(oc.a);
    if (localk != null)
    {
      m localm = paramo.w();
      label132:
      label134:
      do
      {
        do
        {
          if (!localm.e()) {
            return;
          }
          kc[] arrayOfkc = (kc[])localk.get(localm.a());
          if (((bool) || (arrayOfkc != null)) && ((bool) || (arrayOfkc.length > 0)))
          {
            int i1 = 0;
            do
            {
              if (i1 >= arrayOfkc.length) {
                break;
              }
              kc localkc = arrayOfkc[i1];
              b(localkc, paramBoolean);
              i1++;
              if (bool) {
                break label134;
              }
              if (i2 != 0) {
                break label132;
              }
            } while (i2 == 0);
          }
        } while (bool);
        localm.f();
      } while (i2 == 0);
    }
  }
  
  private void d(o paramo, boolean paramBoolean)
  {
    boolean bool = o.eg;
    int i2 = o.dg;
    k localk = paramo.c(oc.b);
    if (localk != null)
    {
      a.c.w localw = paramo.v();
      label132:
      label134:
      do
      {
        do
        {
          if (!localw.e()) {
            return;
          }
          kc[] arrayOfkc = (kc[])localk.get(localw.d());
          if (((bool) || (arrayOfkc != null)) && ((bool) || (arrayOfkc.length > 0)))
          {
            int i1 = 0;
            do
            {
              if (i1 >= arrayOfkc.length) {
                break;
              }
              kc localkc = arrayOfkc[i1];
              a(localkc, paramBoolean);
              i1++;
              if (bool) {
                break label134;
              }
              if (i2 != 0) {
                break label132;
              }
            } while (i2 == 0);
          }
        } while (bool);
        localw.f();
      } while (i2 == 0);
    }
  }
  
  private void a(kc paramkc, boolean paramBoolean)
  {
    a.d.w localw1 = a(new a.d.w(paramkc.d() + paramkc.b() / 2.0D, paramkc.e() + paramkc.c() / 2.0D), paramBoolean);
    a.d.w localw2 = a(new a.d.w(paramkc.a().i(), paramkc.a().j()), paramBoolean);
    paramkc.a().c(localw2.a, localw2.b);
    double d1 = localw1.a() - paramkc.b() / 2.0D;
    double d2 = localw1.b() - paramkc.c() / 2.0D;
    paramkc.b(d1, d2);
  }
  
  private void b(kc paramkc, boolean paramBoolean)
  {
    boolean bool2 = o.eg;
    a.d.w localw1 = a(new a.d.w(paramkc.d() + paramkc.b() / 2.0D, paramkc.e() + paramkc.c() / 2.0D), paramBoolean);
    a.d.w localw2 = a(new a.d.w(paramkc.a().i(), paramkc.a().j()), paramBoolean);
    paramkc.a().c(localw2.a, localw2.b);
    double d1 = localw1.a() - paramkc.b() / 2.0D;
    double d2 = localw1.b() - paramkc.c() / 2.0D;
    paramkc.b(d1, d2);
    boolean bool1 = b(this.m);
    if ((bool2) || (bool1))
    {
      fd localfd1;
      if (paramBoolean)
      {
        localfd1 = paramkc.g();
        byte b = 0;
        if (!bool2) {
          if (localfd1.o()) {
            b = (byte)(b | 0x8);
          }
        }
        if (!bool2) {
          if (localfd1.n()) {
            b = (byte)(b | 0x20);
          }
        }
        if (!bool2)
        {
          if (localfd1.p()) {
            b = (byte)(b | 0x10);
          }
          if (bool2) {}
        }
        else
        {
          if (localfd1.b() == b) {
            return;
          }
          this.k.a(paramkc, localfd1);
        }
        fd localfd2 = (fd)this.l.get(localfd1);
        if (!bool2)
        {
          if (localfd2 == null)
          {
            localfd2 = new fd(localfd1);
            localfd2.b(b);
            this.l.a(localfd1, localfd2);
          }
          paramkc.a(localfd2);
        }
        if (!bool2) {
          if (o.dg == 0) {
            return;
          }
        }
      }
      else
      {
        localfd1 = (fd)this.k.get(paramkc);
      }
      if (localfd1 != null) {
        paramkc.a(localfd1);
      }
    }
  }
  
  public u a(Insets paramInsets)
  {
    return a(new u(paramInsets));
  }
  
  public u a(u paramu)
  {
    if (!o.eg) {
      if (b(this.m))
      {
        switch (this.m)
        {
        case 2: 
          return new u(paramu.d, paramu.c, paramu.b, paramu.e);
        case 1: 
          return new u(paramu.c, paramu.b, paramu.e, paramu.d);
        case 3: 
          return new u(paramu.e, paramu.d, paramu.c, paramu.b);
        }
        return new u(paramu.b, paramu.e, paramu.d, paramu.c);
      }
    }
    switch (this.m)
    {
    case 2: 
      return new u(paramu.d, paramu.e, paramu.b, paramu.c);
    case 1: 
      return new u(paramu.c, paramu.d, paramu.e, paramu.b);
    case 3: 
      return new u(paramu.e, paramu.b, paramu.c, paramu.d);
    }
    return paramu;
  }
  
  public s a(s params)
  {
    switch (this.m)
    {
    case 1: 
    case 3: 
      return new s(params.c(), params.b());
    }
    return new s(params.b(), params.c());
  }
  
  public final class a_
  {
    public static int a;
    
    a_() {}
    
    public a.d.w a(a.d.w paramw)
    {
      return cb.this.b(paramw);
    }
    
    public a.d.w b(a.d.w paramw)
    {
      return cb.this.a(paramw);
    }
  }
  
  private class c_
    extends p
  {
    k c;
    
    c_(k paramk)
    {
      this.c = paramk;
    }
    
    public Object get(Object paramObject)
    {
      boolean bool2 = o.eg;
      cd localcd = (cd)this.c.get(paramObject);
      if (!bool2) {
        if (localcd != null)
        {
          if (bool2) {
            break label698;
          }
          if (!localcd.g())
          {
            boolean bool1 = localcd.a();
            byte b = cb.this.b();
            if (!bool2) {
              if (cb.this.b(b))
              {
                if (!bool2) {
                  switch (b)
                  {
                  case 1: 
                    if (!bool2) {
                      switch (localcd.b())
                      {
                      case 2: 
                        return cd.a((byte)4, bool1);
                      case 8: 
                        return cd.a((byte)1, bool1);
                      case 1: 
                        return cd.a((byte)8, bool1);
                      case 4: 
                        return cd.a((byte)2, bool1);
                      }
                    }
                  case 3: 
                    if (!bool2) {
                      switch (localcd.b())
                      {
                      case 2: 
                        return cd.a((byte)8, bool1);
                      case 4: 
                        return cd.a((byte)1, bool1);
                      case 1: 
                        return cd.a((byte)4, bool1);
                      case 8: 
                        return cd.a((byte)2, bool1);
                      }
                    }
                  case 2: 
                    if (!bool2) {
                      switch (localcd.b())
                      {
                      case 2: 
                        return cd.a((byte)1, bool1);
                      case 4: 
                        return localcd;
                      case 1: 
                        return cd.a((byte)2, bool1);
                      case 8: 
                        return localcd;
                      }
                    }
                  case 0: 
                    if (!bool2) {
                      switch (localcd.b())
                      {
                      case 2: 
                        return localcd;
                      case 4: 
                        return cd.a((byte)8, bool1);
                      case 1: 
                        return localcd;
                      case 8: 
                        return cd.a((byte)4, bool1);
                      }
                    }
                    break;
                  }
                }
                if ((!bool2) && (o.dg == 0)) {
                  return localcd;
                }
              }
            }
            if (!bool2) {}
            switch (b)
            {
            case 1: 
              if (!bool2) {
                switch (localcd.b())
                {
                case 2: 
                  return cd.a((byte)8, bool1);
                case 8: 
                  return cd.a((byte)1, bool1);
                case 1: 
                  return cd.a((byte)4, bool1);
                case 4: 
                  return cd.a((byte)2, bool1);
                }
              }
            case 3: 
              if (!bool2) {
                switch (localcd.b())
                {
                case 2: 
                  return cd.a((byte)4, bool1);
                case 4: 
                  return cd.a((byte)1, bool1);
                case 1: 
                  return cd.a((byte)8, bool1);
                case 8: 
                  return cd.a((byte)2, bool1);
                }
              }
            case 2: 
              if (!bool2) {
                switch (localcd.b())
                {
                case 2: 
                  return cd.a((byte)1, bool1);
                case 4: 
                  return cd.a((byte)8, bool1);
                case 1: 
                  return cd.a((byte)2, bool1);
                case 8: 
                  return cd.a((byte)4, bool1);
                }
              }
              break;
            }
          }
        }
      }
      label698:
      return localcd;
    }
  }
  
  class d_
    extends p
  {
    k c;
    
    d_(k paramk)
    {
      this.c = paramk;
    }
    
    public Object get(Object paramObject)
    {
      Object localObject = this.c.get(paramObject);
      if (!o.eg) {
        if ((localObject instanceof s)) {
          localObject = cb.this.a((s)localObject);
        }
      }
      return localObject;
    }
  }
  
  class b_
    extends p
  {
    k c;
    
    b_(k paramk)
    {
      this.c = paramk;
    }
    
    public Object get(Object paramObject)
    {
      u localu = u.a(this.c.get(paramObject));
      if (!o.eg) {
        if (localu != null) {
          return cb.this.a(localu);
        }
      }
      return localu;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.cb

 * JD-Core Version:    0.7.0.1

 */